package nc.bs.gsp.hf054416;

import java.util.Collection;

import nc.bs.medpub.pub.MedQueryDMO;
import nc.bs.pub.pf.QueryVoContext;
import nc.vo.gsp.hf054416.BHGBSSQHeadVO;
import nc.vo.gsp.pub.GspConst;
import nc.vo.jcom.lang.StringUtil;
import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;

public class GspBhgbssqDMO extends MedQueryDMO {

	
    @Override
    protected String getBillType() {
        return GspConst.BHGBSSQ;
    }
    public Object queryHeadVO(QueryVoContext qvc) throws BusinessException {
        
        return BHGBSSQHeadVO.class;
    }

    public Object queryBodyVO(QueryVoContext qvc) throws BusinessException {
        
        return BHGBSSQHeadVO.class;
    }
    
    public CircularlyAccessibleValueObject[] queryAllBodyData(String key)
			throws BusinessException {
		// TODO Auto-generated method stub
		return null;
	}

	public CircularlyAccessibleValueObject[] queryAllHeadData(String whereString)
			throws BusinessException {

		String strWhere = " nvl(dr,0)=0 ";
		if (!StringUtil.isEmptyWithTrim(whereString)) {
			strWhere += " and (" + whereString + ")";
		}
		Collection rs = getDao().retrieveByClause(BHGBSSQHeadVO.class,
				strWhere);
		if (rs != null && !rs.isEmpty()) {
			return (BHGBSSQHeadVO[]) rs.toArray(new BHGBSSQHeadVO[0]);
		}
		return null;
		
	
	}

	public CircularlyAccessibleValueObject[] queryAllBodyData(String key,
			String whereString) throws BusinessException {
		// TODO Auto-generated method stub
		return null;
	}

}
